﻿<%@ Page Title="" Language="C#" MasterPageFile="~/GT.Site.Master" AutoEventWireup="true" CodeBehind="BusquedaComponente.aspx.cs" Inherits="TMD.GT.Site.ActualizarComponene" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 62px;
        }
        #Button9
        {
            width: 123px;
        }
        #Button2
        {
            width: 116px;
        }
        #Button4
        {
            width: 125px;
        }
        .style2
        {
            width: 102px;
        }
        #Button11
        {
            width: 132px;
        }
    </style>



    <script language="javascript" type="text/javascript">
// <![CDATA[
        function ponerdato(dato) {
            document.getElementById("dato").value = dato;
        }

        function Button4_onclick(tipo) {

            var posicion_x;
            var posicion_y;
            var url, ancho, alto;

            if (tipo != "0") {

                if (document.getElementById("dato").value == -1) {

                    alert("Debe de seleccionar algún componente")
                    return;
                }

            }






            url = "ActualizarComponente.aspx?CODIGO=" + document.getElementById("dato").value + "&TIPO=" + tipo;
            ancho = 700;
            alto = 600;

            posicion_x = (screen.width / 2) - (ancho / 2);
            posicion_y = (screen.height / 2) - (alto / 2);
            window.open(url, "Actualizarcomponente", "width=" + ancho + ",height=" + alto + ",menubar=0,toolbar=0,directories=0,scrollbars=no,resizable=no,left=" + posicion_x + ",top=" + posicion_y, "");


        }




       

function Button9_onclick() {

}

// ]]>
    </script>



</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


<table>
<tr> 
<td>
Código</td>
<td class="style1"> <asp:TextBox ID="txtcodigo" runat="server"></asp:TextBox></td>
<td> Descripción</td>
<td class="style2"> <asp:TextBox ID="txtdescripcion" runat="server"></asp:TextBox></td>
<td> Clase</td>
    
<td> <asp:DropDownList ID="ddlClase" runat="server" 
        >
</asp:DropDownList></td>
<td> <asp:Button ID="Button1" runat="server" Text="Buscar" Width="118px" 
        onclick="Button1_Click" /></td>
</tr>

<tr>
<td colspan ="7">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        Width="639px">  

<Columns>
<asp:TemplateField HeaderText="Seleccione">
        <ItemTemplate>
          <input name="MyRadioButton" type="radio" 
                      onclick="ponerdato('<%# Eval("Codigo") %>');" />
        </ItemTemplate>
      </asp:TemplateField>


<asp:BoundField DataField="Codigo" HeaderText="Codigo" SortExpression="Codigo" HtmlEncode="False">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>

                <asp:BoundField DataField="Nombre" HeaderText="Nombre" SortExpression="Nombre" HtmlEncode="False">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>


                <asp:BoundField DataField="Clase" HeaderText="Clase" SortExpression="Clase" HtmlEncode="False">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>

                <asp:BoundField DataField="Estado" HeaderText="Estado" SortExpression="Estado" HtmlEncode="False">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>

                <asp:BoundField DataField="Etapa" HeaderText="Etapa" SortExpression="Etapa" HtmlEncode="False">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundField>
</Columns>

  </asp:GridView>
</td>
</tr>

<tr>
<td><input id="Button2" type="button" value="Consultar" onclick="Button4_onclick(2)"  /></td>
<td class="style1"><input id="Button9" type="button" value="Crear" onclick="Button4_onclick(0)" onclick="return Button9_onclick()" /></td>
<td><input id="Button4" type="button" value="Modificar" onclick="Button4_onclick(1)"  /></td>
<td class="style2"><asp:Button ID="Button5" runat="server" Text="Anular" 
        Width="119px"/></td>
<td colspan="2"><input id="Button11" type="button" value="Cerrar" onclick="window.close()"  /></td>


</tr>



</table>
    
    <input id="dato"  name ="dato" type="hidden" value="-1"  />
</asp:Content>

